package com.dutao.config;

import com.dutao.common.CustomCommandLineRunner;
import com.dutao.common.CustomProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Bean;

@EnableConfigurationProperties(CustomProperties.class)
public class DutaoAutoConfig {
    @Bean
    @ConditionalOnProperty(prefix = "dutao.auto",name = "enable",havingValue = "true")
    public CustomCommandLineRunner customCommandLineRunner(){
        return new CustomCommandLineRunner();
    }

}
